package com.bms.Dao;

import com.bms.bean.Book;
import org.apache.ibatis.annotations.Param;
import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper;
import org.springframework.stereotype.Repository;

@Repository
public interface BookDao {
    //热门图书推荐
    public Book[] getBookByHot();

    //新书推荐
    public Book[] getBookByOnTime();

    //通过图书作者查询
    public Book[] getBookByAuthor(@Param("author") String author);

    //通过图书ID查询
    public Book getBookById(@Param("bookid") int bookid);

    //通过书名查询
    public Book[] getBookByName(@Param("name") String name);

    //通过书号查询
    public Book[] getBookByNumber(@Param("number") String number);

    //新书上架
    public void onBook(String bookname,String bookauthor,String booknumber,int bookleft,String booklocation,String bookontime);

    //图书借出,减少剩余
    public void subBook(@Param("bookid") int bookid);

    //图书归还或者入库,增加剩余
    public void addBook(@Param("bookid") int bookid, int number);

    //图书根据书号下架
    public void outBook(@Param("booknumber")String bookbumber);
}

